/**
 *     tipple is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    tipple is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with tipple.  If not, see <http://www.gnu.org/licenses/>.
 * Copyright 2009 James Osler, Adam Tomkins
 */



package v0_4;

//~--- JDK imports ------------------------------------------------------------

import java.text.*;

import java.util.*;

public class Beer {
    private double ADC;
    private int    buyCount;
    private double cost;
    private int    id;
    private String name;
    private double percent;
    private int    volume;
    private double AD;

    /**
     * Blank constructor, used in FindBest
     */
    public Beer() {}

    /**
     * Constructor assigns variables and calculates the alcohol density cost for the beer.
     */
    public Beer(int incID, String incName, double incPercent, int incVolume, double incCost) {
        id       = incID;
        name     = incName;
        percent  = incPercent;
        volume   = incVolume;
        cost     = incCost;
        AD       = calcAD(percent, volume);
        ADC      = calcADC(percent, volume, cost);
        buyCount = 1;
    }

    /**
     * Calculates the ADC for input variables.
     */
    public double calcADC(double percent, int volume, double cost) {
        double alcoholDensityCost;
        alcoholDensityCost = ((percent / 100) * volume) / cost;
        return alcoholDensityCost;
    }

    /**
     * Calculates the AD for input variables.
     */
    public double calcAD(double percent, int volume) {
        double alcoholDensity;
        alcoholDensity = ((percent/100)*volume);
        return alcoholDensity;
    }

    /**
     * get arguments.
     */
    public int getid() {
        return id;
    }

    public String getName() {
        return name;
    }

    public double getPercent() {
        return percent;
    }

    public int getVolume() {
        return volume;
    }

    public Double getCost() {
        return cost;
    }

    public double getADC() {
        return ADC;
    }

    public double getAD() {
        return AD;
    }

 //   public int getBuyCount() {
//        return buyCount;
  //  }

    //public void addBuyCount() {
   //     buyCount += 1;
   // }

    /**
     *  Returning the object as a string
     */
//    public String toString() {
//        return "Beer " + id + ", Name= " + name + ", " + percent + "%, �";
//    }

//    public String fileString() {
//        return id + "-" + name + "-" + percent + "-" + volume + "-" + cost;
 //   }

    /**
     * public static void main (String[] args) {
     *  Beer test = new Beer(1,"Sammy",14.0,330,3.39);
     *  Beer test2 = new Beer(1,"Duvel",10.0,330,3.39);
     *  System.out.println(test);
     *  System.out.println(test2);
     * }
     */
}


//~ Formatted by Jindent --- http://www.jindent.com
